import base from './base'

export default (url, data = {}, method = 'GET') => {
	return new Promise((resolve, reject) => {
		uni.request({
			// 小程序端无需跨域的url配置
			url: base.host + url,
			// PC端需要跨域的url配置
			// url,
			data,
			method,
			success: (res) => {
				resolve(res.data);
			},
			fail: (err) => {
				reject(err);
			}
		});
	})
}